package Operation;

import Dao.DataOperation;
import JavaBeans.Book;

import java.util.List;

/**
 * 图书列表显示功能
 */
public class DisplayOperation implements IOperation{

    @Override
    public void operate() {
        String sql = "select * from book_list";
        List<Book> bookList = DataOperation.query(Book.class, sql);
        assert bookList != null;
        if(bookList.size() != 0){
            for (Book b : bookList){
                System.out.println(b);
            }
        }else{
            System.out.println("当前暂无任何图书记录。");
        }
    }
}
